<?php

namespace app\v6\controller;

use think\Db;
use think\facade\Lang;

class PayStatus
{
    public function index()
    {
        $outTradeNo = input('out_trade_no', '');

        $orderInfo = Db::name('zifei_order')->where('order_sn', $outTradeNo)->find();

        if (isset($orderInfo) && !empty($orderInfo['return_url'])) {
            header('Location: '.$orderInfo['return_url']);
            exit();
        }

        echo Lang::get('redirect_failed');
        exit();
    }
}
